﻿using System;
using System.Collections.Generic;
using SimpleVelocity;

/// <summary>
/// This is a basic report object. When on professional app you will have reports more elaborate.
/// </summary>
public class PersonReport : ReportBase
{
    public Helpers Helpers { private set; get; }
    public string Parameter { private set; get; }

    public PersonReport(string parameter)
        : base("PersonReport.vm")
    {
        this.Helpers = new Helpers(); // Helpers (If needed)
        this.Parameter = parameter; // External parameter
    }

    protected override void SetDataContext()
    {
        base.Add("this", this); // this = ALIAS
    }

    #region Methods

    /// <summary>
    /// For Object foreach loop
    /// </summary>
    public List<Person> GetListPerson()
    {
        return new List<Person>()
        {
            new Person("Alfred", 20),
            new Person("Lain", 35),
            new Person("Leco", 25),
            new Person("Bilbo", 50)
        };
    }

    public Dictionary<string, Person> GetDictionaryPerson()
    {
        Dictionary<string, Person> obj = new Dictionary<string, Person>();
        obj.Add("Item 1", new Person("Leco", 25));
        obj.Add("Item 2", new Person("Bras", 45));
        obj.Add("Item 3", new Person("Mari", 42));
        return obj;
    }

    #endregion
}
